package com.zsw.dao;

import com.zsw.entity.Commodity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

/**
 * @author zhangsw
 */
public interface CommodityDao {

    /**
     * 查询商品
     * @param id
     * @return
     */
    @Select("select * from commodity where id=#{id}")
    Commodity selectCommodityById(Integer id);

    /**
     * 插入商品
     * @param commodity
     * @return
     */
    @Insert("insert into commodity (id,price,name) values(#{id},#{price},#{name})")
    Integer insertCommodity(Commodity commodity);
}
